#! /bin/bash

echo "*** querying log"
wget -qO- http://local.httprelay.appspot.com:8080/shortlog | head
echo

echo "*** processing request"
bin/httprelaysrv.py -1 -r http://local.httprelay.appspot.com:8080/ -s http://localhost:8000/

echo "*** getting response"
qtail=$(wget -qO- http://local.httprelay.appspot.com:8080/httprelay/peek/tail | head -n1)
wget -qO- http://local.httprelay.appspot.com:8080/httprelay/fetch/$qtail | head
echo

echo "*** status"
echo "head"
wget -qO- http://local.httprelay.appspot.com:8080/httprelay/peek/head | head -n1
echo
echo "tail"
wget -qO- http://local.httprelay.appspot.com:8080/httprelay/peek/tail | head -n1
echo

